import Vue from 'vue'
import App from './App.vue'
import $ from 'jquery'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min'

import ElementUI from 'element-ui' //element-ui的全部组件
import VueRouter from 'vue-router'
import 'element-ui/lib/theme-chalk/index.css'//element-ui的css


import Login from "./components/Login";
import Container from'./components/MySideBar'
import Dashboard from './pages/DashBoard'
import Template from './pages/template'
import Example from './pages/example'
import College from './pages/college'
import course from "./pages/course";
import Content from './pages/content'
import Information from './pages/information'
import Profession from './pages/profession'
import Contently from './pages/contentType'
import preview from "./pages/preview";
import in_ex_port from "./pages/in_ex_port";
import creatTemplate from "./pages/creatTemplate";
import contentType from "./pages/contentType";
import school from "./pages/school";
import manageAdmin from "./pages/manageAdmin";
import manageTeacher from "./pages/manageTeacher";
import myExample from "./pages/myExample";
import newExample from "./pages/newExample";
import allExample from "./pages/allExample";

Vue.use(ElementUI) //使用elementUI
Vue.use(VueRouter)//使用VueRouter

//启动生产消息
Vue.config.productionTip = true


/*
const routes = [
  { path: '/foo', component: Login, props:true },
  { path: '/bar', component: Web_fill_input, props: (route) => ({
      // props:['dataURL','placeHolder','formName']
      dataURL: route.query.dataURL,
      placeHolder:route.query.placeHolder,
      formName:route.query.formName
    })
  }
]
*/

const routes =[
    {
        path: '/login',
        name: 'Login',
        component: Login
    },
    {
        path: '/',
        redirect: '/dashboard',
        name: 'Container',
        component: Container,
        children: [
            {path: 'school', name: '入驻单位审核', component: school,},
            {path: 'dashboard', name: '首页', component: Dashboard,},
            {path: 'template', name: '模板管理', component: Template, },
            {path: 'example', name: '实例管理', component: Example, },
            {path: 'college', name: '学院管理', component: College, },
            {path: 'course', name: '课程管理', component: course, },
            {path: 'content', name: '内容管理', component: Content, },
            {path: 'information', name: '个人信息管理', component: Information, },
            {path: 'profession', name: '专业管理', component: Profession, },
            {path: 'contently', name: '内容类型管理', component: Contently, },
            {path:'preview',component: preview},
            {path:'in_ex_port',component: in_ex_port},
            {path:'creatTemplate',component: creatTemplate},
            {path:'contentType',component: contentType},
            {path: 'manageAdmin',component:manageAdmin },
            {path: 'manageTeacher',component:manageTeacher },
            {path: 'myExample',component: myExample},
            {path: 'newExample',component:newExample },
            {path: 'allExample',component:allExample },
        ]
    }
]


const router = new VueRouter({
    routes
})


//创建vue实例
/**
 * ES5
 * render: function(creatElement){
 *     return creatElement(App)
 * }
 *
 * ES6
 * render(creatElement){
 *     return creatElement(App)
 * }
 *
 * 简化名称
 * render(h){
 *     return h(App)
 * }
 *
 * 箭头函数
 * render: h=>h(App)
 */
new Vue({
  //实例的内容通过 render提供
  render: h => h(App),
  router
}).$mount('#app')//将本实例手动挂载到app标签 (<div id="app">)

